package com.yh.patterns.decorator.view;

/**
 * @Auther:云尚学Java
 */
public class Client {
    public static void main(String[] args) {
        //文本显示
        Component text=new TextView();
        System.out.println(text.getDesc());
        System.out.println("=========");
        //在文本显示上加一个滚动条
        text=new Roll(text);
        System.out.println(text.getDesc());
        //在文本显示上加一个滚动条，并且再加上一个黑色边框
        text=new BlackBorder(text);
        System.out.println(text.getDesc());

        System.out.println("========");

        Component picture=new PictureView();
        System.out.println(picture.getDesc());
        System.out.println("=========");
        //在文本显示上加一个滚动条
        picture=new Roll(picture);
        System.out.println(picture.getDesc());
        //在文本显示上加一个滚动条，并且再加上一个黑色边框
        picture=new BlackBorder(picture);
        System.out.println(picture.getDesc());
    }
}
